package com.chenhui.myneighbors.controller.study;

import com.chenhui.myneighbors.controller.study.GreetingService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/house")
public class HouseHandler {

    private GreetingService service;

    public HouseHandler(GreetingService service) {
        this.service = service;
    }

    @GetMapping("/all")
    public String all(){
        return "hello my houst!";
    }

    @GetMapping("/greeting")
    public String greeting(){
        return service.greet();
    }
}
